package com.sali.b_design_pattern.e_template_pattern.lesson_entity_wrapper.raw;

import com.sali.b_design_pattern.e_template_pattern.lesson_entity_wrapper.pojo.User01;
import com.sali.b_design_pattern.e_template_pattern.lesson_entity_wrapper.pojo.User02;
import com.sali.b_design_pattern.e_template_pattern.lesson_entity_wrapper.pojo.User03;

/**
 * @description:
 * @author: sali
 * @date: 2024/5/30 22:31.
 * @version: 1.0
 */
public class RawStarter {

    private final static String queryDiskIOSql = "aa";

    private final static String queryDiskUseSql = "bb";

    private final static String queryIndexSql = "cc";

    public static void main(String[] args) {
        User01 user01 = method01(System.currentTimeMillis(), System.currentTimeMillis());
        System.out.println(user01.toString());
        User02 user02 = method02(System.currentTimeMillis(), System.currentTimeMillis());
        System.out.println(user02.toString());
        User03 user03 = method03(System.currentTimeMillis(), System.currentTimeMillis());
        System.out.println(user03.toString());
    }

    private static String logicCommon(Long startTime, Long endTime) {
        return startTime + endTime + "";
    }

    public static User01 method01(Long startTime, Long endTime) {
        String myRes01 = logicCommon(startTime, endTime);
        User01 user01 = mapping01(myRes01, queryDiskIOSql);
        return user01;
    }

    private static User01 mapping01(String input01, String queryDiskIOSql) {
        return User01.builder().name01(input01 + queryDiskIOSql).age01(11).build();
    }

    public static User02 method02(Long startTime, Long endTime) {
        String myRes01 = logicCommon(startTime, endTime);
        User02 user02 = mapping02(myRes01, queryDiskUseSql);
        return user02;
    }

    private static User02 mapping02(String input01, String queryDiskUseSql) {
        return User02.builder().name02(input01 + queryDiskUseSql).age02(11).build();
    }

    public static User03 method03(Long startTime, Long endTime) {
        String myRes01 = logicCommon(startTime, endTime);
        User03 user03 = mapping03(myRes01, queryIndexSql);
        return user03;
    }

    private static User03 mapping03(String input01, String queryIndexSql) {
        return User03.builder().name03(input01 + queryIndexSql).age03(11).build();
    }

}
